<template>
  <el-radio-group v-model="gender" @input="handleInput">
    <el-radio label="1">男</el-radio>
    <el-radio label="2">女</el-radio>
  </el-radio-group>
</template>
<script>
export default {
  name: "GenderSelect",
  watch: {
    // '$attrs.formData.gender': {
    //   handler () {
    //     if (this.$attrs.formData.gender) {
    //       if (typeof this.$attrs.formData.gender === 'string')
    //         this.gender = this.$attrs.formData.gender
    //       else
    //         this.gender = this.$attrs.formData.gender.toString()
    //     }
    //   },
    //   immediate: true
    // }
  },
  data() {
    return {
      gender: null
    };
  },
  methods: {
    handleInput(value) {
      this.$emit("input", value);
    }
  }
};
</script>
